#pragma once
#include "Effect.h"

namespace XamlFx
{
    [Windows::Foundation::Metadata::WebHostHidden]
    public ref class DropShadowEffect sealed : public Effect
    {
    public:
        DropShadowEffect();
        virtual ~DropShadowEffect();
    public:
        DEPENDENCY_PROPERTY(Radius,      double)
        DEPENDENCY_PROPERTY(ShadowDepth, double)
        DEPENDENCY_PROPERTY(Direction,   double)
        DEPENDENCY_PROPERTY(ShadowColor, Windows::UI::Color)
    protected private:
        virtual auto GetEffect(d2d::Bitmap const& input) -> d2d::Effect override;
        virtual void OnInitialized() override;
    private:
         void SetPadding();
         void SetColor();
    private:
        d2d::Effect m_dropShadowEffect;
        d2d::Effect m_affineTransformEffect;
        d2d::Effect m_compositeEffect;
    private:
        static void OnRadiusChanged      (xaml::DependencyObject^ d, xaml::DependencyPropertyChangedEventArgs^ e);
        static void OnShadowDepthChanged (xaml::DependencyObject^ d, xaml::DependencyPropertyChangedEventArgs^ e);
        static void OnDirectionChanged   (xaml::DependencyObject^ d, xaml::DependencyPropertyChangedEventArgs^ e);
        static void OnShadowColorChanged (xaml::DependencyObject^ d, xaml::DependencyPropertyChangedEventArgs^ e);
    };
}
